//
//  MyJobManageTableViewCell.m
//  CYWFrame
//
//  Created by 于顺燊 on 2018/9/21.
//  Copyright © 2018年 Macx. All rights reserved.
//

#import "MyJobManageTableViewCell.h"
#import "UIButton+zt_adjustImageAndTitle.h"
#import "UIButton+EdgeInsets.h"

@implementation MyJobManageTableViewCell

- (void)awakeFromNib {
	[super awakeFromNib];
	
	// Initialization code
	[self.postJobBtn setImage:IMAGE(@"job_icon_down") forState:UIControlStateNormal];
	[self.postJobBtn setImage:IMAGE(@"job_icon_up") forState:UIControlStateSelected];
	[self.postJobBtn setTitle:@"已上架" forState:UIControlStateSelected];
	[self.postJobBtn setTitleColor:UIMainColorRGB forState:UIControlStateSelected];
	[self.postJobBtn layoutButtonWithEdgeInsetsStyle:ButtonEdgeInsetsStyleImageTop imageTitlespace:5];
	
	[self.defaultBtn setImage:IMAGE(@"job_icon_default_grey") forState:UIControlStateNormal];
	[self.defaultBtn setImage:IMAGE(@"job_icon_default_color") forState:UIControlStateSelected];
	[self.defaultBtn setTitleColor:UIMainColorRGB forState:UIControlStateSelected];
	
	self.defaultBtn.zt_contentAdjustType = ZTContentAdjustImageUpTitleDown;
	[self.defaultBtn zt_beginAdjustContent];
	
	[self.previewBtn setImage:IMAGE(@"job_icon_preview") forState:UIControlStateNormal];
	self.previewBtn.zt_contentAdjustType = ZTContentAdjustImageUpTitleDown;
	[self.previewBtn zt_beginAdjustContent];
	
	[self.editBtn setImage:IMAGE(@"job_icon_edit") forState:UIControlStateNormal];
	self.editBtn.zt_contentAdjustType = ZTContentAdjustImageUpTitleDown;
	[self.editBtn zt_beginAdjustContent];
	
	[self.deleteBtn setImage:IMAGE(@"job_icon_delete") forState:UIControlStateNormal];
	self.deleteBtn.zt_contentAdjustType = ZTContentAdjustImageUpTitleDown;
	[self.deleteBtn zt_beginAdjustContent];
	
	self.layer.cornerRadius = 10;
}

- (void)setFrame:(CGRect)frame
{
	frame.origin.x += 10;
	frame.origin.y += 10;
	
	frame.size.width -= 20;
	frame.size.height -= 10;
	
	[super setFrame:frame];
}

- (IBAction)setDefault:(id)sender {
	[self.delegate setDefaultJob:sender :self.positionId];
}

- (IBAction)preview:(id)sender {
	[self.delegate previewJob:sender :self.positionId];
}

- (IBAction)edit:(id)sender {
	[self.delegate editJob:sender :self.positionId];
}

- (IBAction)delete:(id)sender {
	[self.delegate deleteJob:sender :self.positionId];
}
- (IBAction)postJob:(id)sender {
	[self.delegate postJob:sender :self.positionId];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
